<?php

namespace app\validate\home;

use app\common\validate\BaseValidate;

/**
 * Class Validate
 * https://www.kancloud.cn/manual/thinkphp6_0/1037624
 * @package app\daily\validate
 */
class Order extends BaseValidate
{
    //定义验证规则
    protected $rule = [
        're_id|关联id' => 'require',
        'order_type|订单类型' => 'require',
        'order_count|数量' => 'require',
        'store_id|门店id' => 'require',
        'pay_price|付款金额' => 'require',
        'pay_type|付款方式' => 'require',
        'order_no|订单编号' => 'require',
        'book_id|预约ID' => 'require|number'
    ];

    //定义验证场景要与方法名相同走自动验证
    protected $scene = [
        'create' => ['order_count', 'pay_price', 'pay_type'],
        'update' => ['order_no', 'book_id'],
        'balancePay' => ['order_no'],
        'clearCart' => ['order_no']
    ];

}
